//
//  UIImageView+Progress.h
//  MMBangADDemoProject
//
//  Created by CuiPanJun on 14-9-24.
//  Copyright (c) 2014年 CuiPanJun. All rights reserved.
//

#import <UIKit/UIKit.h>
#import "SDWebImageManager.h"
#import "UIImageView+WebCache.h"

typedef NS_ENUM(NSInteger, ProgressStyle) {
    ProgressStyle_Defaut = 1,
    ProgressStyle_MMBProgress
};

@protocol UIProgressDelegate <NSObject>

- (void)setProgress:(float)progress;

@end

@interface UIImageView (Progress)

- (void)setupWithActivityIndicator:(UIView *)indicatorView;
- (void)setupWithProgressView:(UIView<UIProgressDelegate> *)progressView;

- (void)showProgress:(BOOL)show;
- (void)setProgress:(float)progress;

- (void)startActivityAnimation;
- (void)stopActivityAnimating;

- (void)mmb_setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder;

- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder showProgress:(BOOL)show;
- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder showProgress:(BOOL)show andProgressStyle:(ProgressStyle)progressStyle;

- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completeblock:(SDWebImageCompletionBlock)outBlock showProgress:(BOOL)show;
- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completeblock:(SDWebImageCompletionBlock)outBlock showProgress:(BOOL)show andProgressStyle:(ProgressStyle)progressStyle;

- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completeblock:(SDWebImageCompletionBlock)outBlock showProgress:(BOOL)show showFailView:(BOOL)showFail;
- (void)setImageWithURL:(NSURL *)url placeholderImage:(UIImage *)placeholder completeblock:(SDWebImageCompletionBlock)outBlock showProgress:(BOOL)show showFailView:(BOOL)showFail andProgressStyle:(ProgressStyle)progressStyle;
@end
